#pragma once


// CDlgListSource dialog

class CDlgListSource : public CDialog
{
	DECLARE_DYNAMIC(CDlgListSource)

public:
	CDlgListSource(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgListSource();
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnBnClickedButtonAdd();
	afx_msg void OnBnClickedButtonEdit();
	afx_msg void OnBnClickedButtonUpdate();
	afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButtonFindSource();

	afx_msg void OnEnChangeEditFind();

	afx_msg void OnLvnItemchangedListLinks(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnGetdispinfoListLinks(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnHdnItemclickListLinks(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnOdfinditemListLinks(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclkListLinks(NMHDR *pNMHDR, LRESULT *pResult);

// Dialog Data
	enum { IDD = IDD_DIALOG_LIST_SOURCE };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
	void FillList(LONG nID=-1);
	INT SetDefaultButton(const DWORD nNewId);

	LONG m_nStaffID;
	CArray<SOURCE_LINK> m_aLinksList;

	CListCtrl m_ctrlLinksList;
	CString m_szFilter;
	CString m_szSort;
	BOOL m_bSortAscending;
	INT m_nCurrentSort;
	INT m_nCurrentRecord;
	CString m_szFind;	
};
